from django.db import models
#encoding: utf-8
from django.db import models

class Message(models.Model):
    username=models.CharField(max_length=256)
    title=models.CharField(max_length=512)
    content=models.TextField(max_length=256)
    publish=models.DateTimeField()

	#为了显示
    def __str__(self):
        liuyanbu = '<Message:[username={username}, title={title}, content={content}, publish={publish}]>'
        return liuyanbu.format(username=self.username, title=self.title, content=self.content, publish=self.publish)

    class Meta:
        db_table = 'guestbook'  # 指明数据库表名
        verbose_name_plural = '留言簿管理'  # 在admin站点中显示的名称
# Create your models here.
